package com.asman.base.lib.glide

import android.content.Context
import androidx.annotation.NonNull
import com.bumptech.glide.GlideBuilder
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.load.DecodeFormat
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.module.AppGlideModule
import com.bumptech.glide.request.RequestOptions

@GlideModule
class MyAppGlideModule : AppGlideModule() {

//    override fun isManifestParsingEnabled(): Boolean {
//        return false
//    }
//
//    override fun applyOptions(@NonNull context: Context, @NonNull builder: GlideBuilder) {
//        val requestOptions = RequestOptions()
////            .centerCrop()
//            .dontAnimate()
//            .disallowHardwareConfig()
////            .placeholder(AsmanConfig.glidePlaceHolder)//占位图
////            .error(AsmanConfig.glidePlaceHolder)
//            .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)//表示让Glide根据图片资源智能地选择使用哪一种缓存策略（默认选项）。
//            .format(DecodeFormat.PREFER_ARGB_8888)
//        builder.setDefaultRequestOptions(requestOptions)
//    }

//    @Override
//    public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
//        super.registerComponents(context, glide, registry);
//    }
}